Crate swift_rs

source ·
Expand description

Call Swift functions from Rust with ease!

Macros

  • Run code with its own autorelease pool. Semantically, this is identical to @autoreleasepool in Objective-C
  • Declares a function defined in a swift library. As long as this macro is used, retain counts of arguments and return values will be correct.

Structs

  • General array type for objects and scalars.
  • Convenience type for working with byte buffers, analagous to SRData in Swift.
  • Wrapper for arbitrary NSObject types.
  • String type that can be shared between Swift and Rust.
  • Builder for linking the Swift runtime and custom packages.
  • Reference to an NSObject for internal use by swift!.

Traits

  • Identifies a type as being a valid argument in a Swift function.
  • A type that is represented as an NSObject in Swift.
  • Identifies a type as being a valid return type from a Swift function. For types that are objects which need extra retains, the retain function will be re-implemented.

Type Definitions